<!-- src/views/HomeView.vue -->
<template>
  <div>
    <h1>欢迎来到首页！</h1>
    <p>你已成功登录。</p>
    <button @click="logout">退出登录</button>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const logout = () => {
  localStorage.removeItem('token')
  router.push({ name: 'Login' })
}
</script>